package ph.loong.deliveryman.ui.work

import android.os.Bundle
import android.support.v4.app.Fragment
import deliveryman.loong.ph.deliveryman.R
import kotlinx.android.synthetic.main.activity_work.*
import ph.loong.deliveryman.adapter.WorkFragmentAdapter
import ph.loong.deliveryman.base.BaseActivity
import ph.loong.deliveryman.fragment.work.WorkDoneFragment
import ph.loong.deliveryman.fragment.work.WorkExceptionFragment
import java.util.*

class WorkActivity : BaseActivity() {
    private var mFragments: MutableList<Fragment> = ArrayList()

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_work)
        setTitle("工作汇总")
        initFragment()
    }

    private fun initFragment() {
        mFragments.add(WorkDoneFragment())
        mFragments.add(WorkExceptionFragment())
        val fragments = WorkFragmentAdapter(supportFragmentManager, mFragments)
        work_viewPager.adapter = fragments
        work_tableLayout.setupWithViewPager(work_viewPager)
    }
}
